{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/rkreit/Dropbox/Research/MRP Racial Resentment/Perspectives on Politics/Final Files/Replication Files/replicate_resentmentperspectives.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res} 3 Jul 2019, 12:32:17
{txt}
{com}. 
. /*      ************************************************************    */
. /*      File Name:      Racial Resentment Figures                                               */
. /*      Date:           July 2, 2019                                                                    */
. /*      Author:         Rebecca Kreitzer                                                                */      
. /*      Input File:     resentmentscore_fromR                                                   */
. /*                                      fips_stateno.dta                                                                */
. /*      Output File:state_resentment.dta                                                        */
. /*              Programs:       grc1leg                                                                                 */
. /*                                      estout                                                                                  */
. /*                                      maptiles                                                                                */
. /*      ************************************************************    */
. 
.          /********************************/
.         * Figure 1: National Relative Racial Resentment, 1988-2016                                                      
.         * note: Note: Aggregate ANES annual racial resentment for all respondents and for White respondents, from 1988-2016.
.         /*********************************/
. 
. use anes_timeseries_cdf_stata12, clear
{txt}
{com}. 
. tab VCF9039 

  {txt}RACIAL RESENTMENT: Conditions Make it {c |}
        Difficult for Blacks to Succeed {c |}      Freq.     Percent        Cum.
{hline 40}{c +}{hline 35}
                      1. Agree strongly {c |}{res}      2,635       12.13       12.13
{txt}                      2. Agree somewhat {c |}{res}      5,640       25.95       38.08
{txt}          3. Neither agree nor disagree {c |}{res}      2,201       10.13       48.21
{txt}                   4. Disagree somewhat {c |}{res}      4,166       19.17       67.38
{txt}                   5. Disagree strongly {c |}{res}      3,275       15.07       82.45
{txt}                                  8. DK {c |}{res}        117        0.54       82.99
{txt}9. NA; no Post IW; form A (1986); form  {c |}{res}      3,697       17.01      100.00
{txt}{hline 40}{c +}{hline 35}
                                  Total {c |}{res}     21,731      100.00
{txt}
{com}.         gen raceresent1 = .
{txt}(55,674 missing values generated)

{com}.         replace raceresent1 = 5 if VCF9039  == 5
{txt}(3,275 real changes made)

{com}.         replace raceresent1 = 4 if VCF9039  == 4
{txt}(4,166 real changes made)

{com}.         replace raceresent1 = 3 if VCF9039  == 3        
{txt}(2,201 real changes made)

{com}.         replace raceresent1 = 2 if VCF9039  == 2        
{txt}(5,640 real changes made)

{com}.         replace raceresent1 = 1 if VCF9039  == 1
{txt}(2,635 real changes made)

{com}.         
. tab VCF9040

   {txt}RACIAL RESENTMENT: Blacks Should Not {c |}
         Have Special Favors to Succeed {c |}      Freq.     Percent        Cum.
{hline 40}{c +}{hline 35}
                      1. Agree strongly {c |}{res}      6,743       29.30       29.30
{txt}                      2. Agree somewhat {c |}{res}      6,218       27.02       56.32
{txt}          3. Neither agree nor disagree {c |}{res}      2,611       11.35       67.67
{txt}                   4. Disagree somewhat {c |}{res}      2,423       10.53       78.20
{txt}                   5. Disagree strongly {c |}{res}      1,207        5.25       83.44
{txt}                                  8. DK {c |}{res}        103        0.45       83.89
{txt}9. NA; no Post IW; form A (1986); form  {c |}{res}      3,707       16.11      100.00
{txt}{hline 40}{c +}{hline 35}
                                  Total {c |}{res}     23,012      100.00
{txt}
{com}.         gen raceresent2 = .
{txt}(55,674 missing values generated)

{com}.         replace raceresent2 = 5 if VCF9040  == 1
{txt}(6,743 real changes made)

{com}.         replace raceresent2 = 4 if VCF9040  == 2
{txt}(6,218 real changes made)

{com}.         replace raceresent2 = 3 if VCF9040  == 3        
{txt}(2,611 real changes made)

{com}.         replace raceresent2 = 2 if VCF9040  == 4        
{txt}(2,423 real changes made)

{com}.         replace raceresent2 = 1 if VCF9040  == 5
{txt}(1,207 real changes made)

{com}.         
. tab VCF9041

     {txt}RACIAL RESENTMENT: Blacks Must Try {c |}
                      Harder to Succeed {c |}      Freq.     Percent        Cum.
{hline 40}{c +}{hline 35}
                      1. Agree strongly {c |}{res}      4,056       18.66       18.66
{txt}                      2. Agree somewhat {c |}{res}      5,779       26.59       45.26
{txt}          3. Neither agree nor disagree {c |}{res}      2,979       13.71       58.97
{txt}                   4. Disagree somewhat {c |}{res}      3,340       15.37       74.34
{txt}                   5. Disagree strongly {c |}{res}      1,750        8.05       82.39
{txt}                                  8. DK {c |}{res}        113        0.52       82.91
{txt}9. NA; no Post IW; form A (1986); form  {c |}{res}      3,714       17.09      100.00
{txt}{hline 40}{c +}{hline 35}
                                  Total {c |}{res}     21,731      100.00
{txt}
{com}.         gen raceresent3 = .
{txt}(55,674 missing values generated)

{com}.         replace raceresent3 = 5 if VCF9040  == 1
{txt}(6,743 real changes made)

{com}.         replace raceresent3 = 4 if VCF9040  == 2
{txt}(6,218 real changes made)

{com}.         replace raceresent3 = 3 if VCF9040  == 3        
{txt}(2,611 real changes made)

{com}.         replace raceresent3 = 2 if VCF9040  == 4        
{txt}(2,423 real changes made)

{com}.         replace raceresent3 = 1 if VCF9040  == 5
{txt}(1,207 real changes made)

{com}.         
. tab VCF9042

  {txt}RACIAL RESENTMENT: Blacks Gotten Less {c |}
    than They Deserve Over the Past Few {c |}
                                  Years {c |}      Freq.     Percent        Cum.
{hline 40}{c +}{hline 35}
                      1. Agree strongly {c |}{res}      1,619        7.04        7.04
{txt}                      2. Agree somewhat {c |}{res}      3,773       16.40       23.43
{txt}          3. Neither agree nor disagree {c |}{res}      4,099       17.81       41.24
{txt}                   4. Disagree somewhat {c |}{res}      5,551       24.12       65.37
{txt}                   5. Disagree strongly {c |}{res}      4,083       17.74       83.11
{txt}                                  8. DK {c |}{res}        184        0.80       83.91
{txt}9. NA; no Post IW; form A (1986); form  {c |}{res}      3,703       16.09      100.00
{txt}{hline 40}{c +}{hline 35}
                                  Total {c |}{res}     23,012      100.00
{txt}
{com}.         gen raceresent4 = .
{txt}(55,674 missing values generated)

{com}.         replace raceresent4 = 5 if VCF9042  == 5
{txt}(4,083 real changes made)

{com}.         replace raceresent4 = 4 if VCF9042  == 4
{txt}(5,551 real changes made)

{com}.         replace raceresent4 = 3 if VCF9042  == 3        
{txt}(4,099 real changes made)

{com}.         replace raceresent4 = 2 if VCF9042  == 2        
{txt}(3,773 real changes made)

{com}.         replace raceresent4 = 1 if VCF9042  == 1
{txt}(1,619 real changes made)

{com}. 
. gen resentraw = raceresent1 + raceresent2 + raceresent3 + raceresent4
{txt}(37,937 missing values generated)

{com}. gen resentrs = resentraw / 20   
{txt}(37,937 missing values generated)

{com}.         
. tab VCF0004

      {txt}STUDY {c |}
  VARIABLE: {c |}
    Year of {c |}
      Study {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
       1948 {c |}{res}        662        1.19        1.19
{txt}       1952 {c |}{res}      1,899        3.41        4.60
{txt}       1954 {c |}{res}      1,139        2.05        6.65
{txt}       1956 {c |}{res}      1,762        3.16        9.81
{txt}       1958 {c |}{res}      1,450        2.60       12.42
{txt}       1960 {c |}{res}      1,181        2.12       14.54
{txt}       1962 {c |}{res}      1,297        2.33       16.87
{txt}       1964 {c |}{res}      1,571        2.82       19.69
{txt}       1966 {c |}{res}      1,291        2.32       22.01
{txt}       1968 {c |}{res}      1,557        2.80       24.80
{txt}       1970 {c |}{res}      1,507        2.71       27.51
{txt}       1972 {c |}{res}      2,705        4.86       32.37
{txt}       1974 {c |}{res}      1,575        2.83       35.20
{txt}       1976 {c |}{res}      2,248        4.04       39.24
{txt}       1978 {c |}{res}      2,304        4.14       43.37
{txt}       1980 {c |}{res}      1,614        2.90       46.27
{txt}       1982 {c |}{res}      1,418        2.55       48.82
{txt}       1984 {c |}{res}      2,257        4.05       52.87
{txt}       1986 {c |}{res}      2,176        3.91       56.78
{txt}       1988 {c |}{res}      2,040        3.66       60.45
{txt}       1990 {c |}{res}      1,980        3.56       64.00
{txt}       1992 {c |}{res}      2,485        4.46       68.47
{txt}       1994 {c |}{res}      1,795        3.22       71.69
{txt}       1996 {c |}{res}      1,714        3.08       74.77
{txt}       1998 {c |}{res}      1,281        2.30       77.07
{txt}       2000 {c |}{res}      1,807        3.25       80.32
{txt}       2002 {c |}{res}      1,511        2.71       83.03
{txt}       2004 {c |}{res}      1,212        2.18       85.21
{txt}       2008 {c |}{res}      2,322        4.17       89.38
{txt}       2012 {c |}{res}      5,914       10.62      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}     55,674      100.00
{txt}
{com}.         gen year = .
{txt}(55,674 missing values generated)

{com}.         replace year = VCF0004 if VCF0004 > 1986
{txt}(24,061 real changes made)

{com}. 
. tab VCF0106

          {txt}Race summary, 3 {c |}
               categories {c |}      Freq.     Percent        Cum.
{hline 26}{c +}{hline 35}
0. Missing, pre-1966 data {c |}{res}         55        0.10        0.10
{txt}    1. White non-Hispanic {c |}{res}     42,997       78.84       78.94
{txt}    2. Black non-Hispanic {c |}{res}      6,509       11.94       90.88
{txt}                 3. Other {c |}{res}      4,606        8.45       99.33
{txt}    9. Missing, DK/REF/NA {c |}{res}        368        0.67      100.00
{txt}{hline 26}{c +}{hline 35}
                    Total {c |}{res}     54,535      100.00
{txt}
{com}.         gen white = .
{txt}(55,674 missing values generated)

{com}.         replace white = 1 if VCF0106 == 1
{txt}(42,997 real changes made)

{com}. 
. * get the avg score for each year for all races and for whites
. * these values are recorded in a few file, anes_collapsed
. sum resentrs if year == 1988    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      1,723    .7014219    .1934602         .2          1
{txt}
{com}. sum resentrs if year == 1988 & white == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      1,335    .7327715    .1796084         .2          1
{txt}
{com}. sum resentrs if year == 1990    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}        954    .6571803     .196849         .2          1
{txt}
{com}. sum resentrs if year == 1990 & white == 1       

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}        728    .6820742    .1896154         .2          1
{txt}
{com}. sum resentrs if year == 1992    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      2,203    .6848843    .2013935         .2          1
{txt}
{com}. sum resentrs if year == 1992 & white == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      1,699    .7144497    .1916511         .2          1
{txt}
{com}. sum resentrs if year == 1994    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      1,737    .7027058    .1841225         .2          1
{txt}
{com}. sum resentrs if year == 1994 & white == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      1,340    .7276493    .1730931         .2          1
{txt}
{com}. sum resentrs if year == 1996    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}          0
{txt}
{com}. sum resentrs if year == 1996 & white == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}          0
{txt}
{com}. sum resentrs if year == 1998    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}          0
{txt}
{com}. sum resentrs if year == 1998 & white == 1       

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}          0
{txt}
{com}. sum resentrs if year == 2000    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      1,519    .7088545    .1980528         .2          1
{txt}
{com}. sum resentrs if year == 2000 & white == 1       

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      1,179    .7299406    .1902618         .2          1
{txt}
{com}. sum resentrs if year == 2002    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}          0
{txt}
{com}. sum resentrs if year == 2002 & white == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}          0
{txt}
{com}. sum resentrs if year == 2004    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      1,050    .6895714    .2082505         .2          1
{txt}
{com}. sum resentrs if year == 2004 & white == 1       

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}        746    .7246649    .1954556         .2          1
{txt}
{com}. sum resentrs if year == 2008    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      2,067    .6895985    .1944242         .2          1
{txt}
{com}. sum resentrs if year == 2008 & white == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      1,034     .738588    .1892829         .2          1
{txt}
{com}. sum resentrs if year == 2012    

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      5,453    .7063543    .2083049         .2          1
{txt}
{com}. sum resentrs if year == 2012 & white == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}resentrs {c |}{res}      3,262    .7511189     .194578         .2          1
{txt}
{com}. 
. 
. use anes_collapsed, clear
{txt}
{com}. 
. twoway line resentall year, lcolor(gs5) lpattern(solid) legend(label(1 "All People")) ///
>         || line resentwhite year, lcolor(gs13) lpattern(longdashed) legend(label(2 "Whites Only")) ///
>         xtitle("Year", size(medium)) ylabel(0(.1)1) graphregion(color(white)) 
{p 0 4 2}
{txt}(note:  named style
longdashed not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
longdashed not found in class
linepattern,  default attributes used)
{p_end}
{res}{txt}
{com}. 
. 
. 
.         
. clear
{txt}
{com}. import excel final_result_long, firstrow
{res}{txt}
{com}.         merge m:1 state_abbrev using fips_stateno.dta
{res}
{txt}{col 5}Result{col 38}# of obs.
{col 5}{hline 41}
{col 5}not matched{col 30}{res}               0
{txt}{col 5}matched{col 30}{res}             450{txt}  (_merge==3)
{col 5}{hline 41}

{com}.         rename fips statefips
{res}{txt}
{com}.         drop _merge
{txt}
{com}.         save state_resentment.dta, replace
{txt}file state_resentment.dta saved

{com}. 
. * rescale the resentment score for ease of interpretation and some other necessary coding
. 
.         label var resent_score "Racial Resentment"      
{txt}
{com}.         
. gen resent1988 = resent_score if year == 1988
{txt}(400 missing values generated)

{com}. gen resent1990 = resent_score if year == 1990
{txt}(400 missing values generated)

{com}. gen resent1992 = resent_score if year == 1992
{txt}(400 missing values generated)

{com}. gen resent1994 = resent_score if year == 1994
{txt}(400 missing values generated)

{com}. gen resent2000 = resent_score if year == 2000
{txt}(400 missing values generated)

{com}. gen resent2004 = resent_score if year == 2004
{txt}(400 missing values generated)

{com}. gen resent2008 = resent_score if year == 2008
{txt}(400 missing values generated)

{com}. gen resent2012 = resent_score if year == 2012
{txt}(400 missing values generated)

{com}. gen resent2016 = resent_score if year == 2016
{txt}(400 missing values generated)

{com}. 
. 
. 
.         
.         /*********************************/
.         * Figure 2: Figure 2. Sample of 8 States’ Racial Resentment, 1988-2016
.         * note: This selection of states represents a range of state trend lines, including some of the states with the highest and lowest racial 
.         * resentment. Note, however, that the relative ordering of these states is not constant, and the state trends follow different trajectories. 
.         /*********************************/     
.         
. sort stateno1 year
{txt}
{com}.         
. twoway line resent_score year if state_abbrev=="AZ"  ,  lcolor(gs12) lpattern(longdash) legend(label(1 "Arizona")) ///
>         || line resent_score year if state_abbrev=="UT"  ,  lcolor(gs11) lpattern(longdash_dot) legend(label(2 "Utah")) ///
>         || line resent_score year if state_abbrev=="HI"  ,  lcolor(gs10) lpattern(shortdash) legend(label(3 "Hawaii")) ///
>         || line resent_score year if state_abbrev=="WV"  ,  lcolor(gs9) lpattern(dash) legend(label(4 "West Virginia")) ///
>         || line resent_score year if state_abbrev=="CA"  ,  lcolor(gs8) lpattern(solid) legend(label(5 "California")) ///       
>         || line resent_score year if state_abbrev=="VT"  ,  lcolor(gs6) lpattern(shortdash_dot) legend(label(6 "Vermont")) ///  
>         || line resent_score year if state_abbrev=="RI"  ,  lcolor(gs4) lpattern(longdash) legend(label(7 "Rhode Island")) ///
>         || line resent_score year if state_abbrev=="MS"  ,  lcolor(gs2) lpattern(solid) legend(label(8 "Mississippi")) ///
>         xtitle("Year", size(medium)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white))   
{res}{txt}
{com}.         
.         /*********************************/
.         * Figure 3: Figure 3. Annual Relative Racial Resentment in the States, 1988-2016
.         * note: Quintiles for each map are calculated using data from that year only. As such, the individual maps should not be directly compared 
.         * to each other. However, it is appropriate to compare to maps to observe patterns in which states have racial resentment scores in the 
.         * higher and low quintiles of the data.
.         /*********************************/
. 
.         * generate quintiles for maps for each year
. xtile yearquintile88=resent1988, n(5)
{txt}
{com}. xtile yearquintile90=resent1990, n(5)
{txt}
{com}. xtile yearquintile92=resent1992, n(5)
{txt}
{com}. xtile yearquintile94=resent1994, n(5)
{txt}
{com}. xtile yearquintile00=resent2000, n(5)
{txt}
{com}. xtile yearquintile04=resent2004, n(5)
{txt}
{com}. xtile yearquintile08=resent2008, n(5)
{txt}
{com}. xtile yearquintile12=resent2012, n(5)
{txt}
{com}. xtile yearquintile16=resent2016, n(5)
{txt}
{com}. 
. *quintile maps by year
.  maptile yearquintile88 if year == 1988, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("1988")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("1988qbw") replace
{res}{txt}(note: file 1988qbw.gph not found)
{res}{txt}(file 1988qbw.gph saved)

{com}.         
.  maptile yearquintile90 if year == 1990, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("1990")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("1990qbw") replace
{res}{txt}(note: file 1990qbw.gph not found)
{res}{txt}(file 1990qbw.gph saved)

{com}.         
.  maptile yearquintile92 if year == 1992, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("1992")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("1992qbw") replace
{res}{txt}(note: file 1992qbw.gph not found)
{res}{txt}(file 1992qbw.gph saved)

{com}.         
.  maptile yearquintile94 if year == 1994, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("1994")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("1994qbw") replace    
{res}{txt}(note: file 1994qbw.gph not found)
{res}{txt}(file 1994qbw.gph saved)

{com}.         
.  maptile yearquintile00 if year == 2000, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2000")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("2000qbw") replace
{res}{txt}(note: file 2000qbw.gph not found)
{res}{txt}(file 2000qbw.gph saved)

{com}.                 
.  maptile yearquintile04 if year == 2004, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2004")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("2004qbw") replace
{res}{txt}(note: file 2004qbw.gph not found)
{res}{txt}(file 2004qbw.gph saved)

{com}.                         
.  maptile yearquintile08 if year == 2008, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2008")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("2008qbw") replace            
{res}{txt}(note: file 2008qbw.gph not found)
{res}{txt}(file 2008qbw.gph saved)

{com}.                 
.  maptile yearquintile12 if year == 2012, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2012")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("2012qbw") replace            
{res}{txt}(note: file 2012qbw.gph not found)
{res}{txt}(file 2012qbw.gph saved)

{com}. 
.  maptile yearquintile16 if year == 2016, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2016") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("2016qbw") replace 
{res}{txt}(note: file 2016qbw.gph not found)
{res}{txt}(file 2016qbw.gph saved)

{com}. 
. * create the map for figure 3
. graph combine 1988qbw.gph 1990qbw.gph 1992qbw.gph 1994qbw.gph 2000qbw.gph 2004qbw.gph 2008qbw.gph 2012qbw.gph 2016qbw.gph, scheme(s1color)  
{res}{txt}
{com}.         
.         /*********************************/
.         * Figure 4: Figure 4. Changes in Estimated Racial Resentment Over Time  
.         * note: This figure shows the estimated racial resentment in each state, in each year of the data. The states are sorted vertically by racial 
.         * resentment scores in 1988. States at the top of the figure have low racial resentment.
.         /*********************************/
. 
. graph dot resent1988 resent1990 resent1992 resent1994 resent2000 resent2004 ///
>         resent2008 resent2012 resent2016, over(state_abbrev, sort(resent2016) label(labsize(vsmall))) nofill ndots(60) ///
>         marker(1, mcolor(black) msymbol(circle_hollow) msize(small)) ///
>         marker(2, mcolor(gs2) msymbol(plus) msize(small)) ///
>         marker(3, mcolor(gs4) msymbol(diamond_hollow) msize(small))  /// 
>         marker(4, mcolor(gs6) msymbol(triangle_hollow) msize(small))  /// 
>         marker(5, mcolor(gs8) msymbol(square_hollow) msize(small))  /// 
>         marker(6, mcolor(gs9) msymbol(circle) msize(small))  /// 
>         marker(7, mcolor(gs10) msymbol(diamond) msize(small))  /// 
>         marker(8, mcolor(gs11) msymbol(triangle) msize(small))  /// 
>         marker(9, mcolor(gs12) msymbol(square) msize(small))  /// 
>         graphregion(margin(medsmall)) legend(row(1) label(1 "1988") label(2 "1990") label(3 "1992") ///
>         label(4 "1994") label(5 "2000") label(6 "2004") label(7 "2008") label(8 "2012") label(9 "2016")) ///
>         ylabel(#25, labsize(small))  graphregion(color(white))
{res}{txt}
{com}.         
.         /*********************************/
.         * Figure 5: Mapping Changes in Racial Resentment in the States Over Time, 1988-2016     
.         * note: Quintiles for each map are calculated using data all years pooled. Each state in each year represents a separate observation in the data.  
.         * As such, one can compare the level of racial resentment in the states across map years.
.         /*********************************/
.         
. xtile quintile=resent_score, n(5)
{txt}
{com}. 
.  maptile quintile if year == 1988, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("1988")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("t1988qbw") replace
{res}{txt}(note: file t1988qbw.gph not found)
{res}{txt}(file t1988qbw.gph saved)

{com}.         
.  maptile quintile if year == 1990, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("1990")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("t1990qbw") replace
{res}{txt}(note: file t1990qbw.gph not found)
{res}{txt}(file t1990qbw.gph saved)

{com}.         
.  maptile quintile if year == 1992, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("1992")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("t1992qbw") replace
{res}{txt}(note: file t1992qbw.gph not found)
{res}{txt}(file t1992qbw.gph saved)

{com}.         
.  maptile quintile if year == 1994, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("1994")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("t1994qbw") replace
{res}{txt}(note: file t1994qbw.gph not found)
{res}{txt}(file t1994qbw.gph saved)

{com}.         
.  maptile quintile if year == 2000, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2000")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("t2000qbw") replace
{res}{txt}(note: file t2000qbw.gph not found)
{res}{txt}(file t2000qbw.gph saved)

{com}.         
.  maptile quintile if year == 2004, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2004")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("t2004qbw") replace
{res}{txt}(note: file t2004qbw.gph not found)
{res}{txt}(file t2004qbw.gph saved)

{com}.                         
.  maptile quintile if year == 2008, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2008")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("t2008qbw") replace
{res}{txt}(note: file t2008qbw.gph not found)
{res}{txt}(file t2008qbw.gph saved)

{com}.         
.  maptile quintile if year == 2012, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2012")legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("t2012qbw") replace
{res}{txt}(note: file t2012qbw.gph not found)
{res}{txt}(file t2012qbw.gph saved)

{com}. 
.  maptile quintile if year == 2016, geo(state) geoid(statefips) cutvalue(1 2 3 4) fcolor(Greys) ///
>         legd(0) twopt(title("2016") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5"))) ///
>         savegraph("t2016qbw") replace
{res}{txt}(note: file t2016qbw.gph not found)
{res}{txt}(file t2016qbw.gph saved)

{com}.         
. graph combine t1988qbw.gph t1990qbw.gph t1992qbw.gph t1994qbw.gph t2000qbw.gph t2004qbw.gph t2008qbw.gph t2012qbw.gph t2016qbw.gph, scheme(s1color) 
{res}{txt}
{com}. 
.         ////////////////////////////////////////////////////////////////////////////
>         
.         /*********************************/
.         * Figure A1: Racial Resentment in Individual States, Over Time  
.         /*********************************/
.         
. twoway line resent_score year if state_abbrev=="AL" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Alabama", size(huge)) name(al, replace) 
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="AK" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///   
>         ylabel(, labsize(large)) title("Alaska", size(huge)) name(ak, replace)          
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="AZ" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Arizona", size(huge)) name(az, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="AR" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Arkansas", size(huge)) name(ar, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="CA" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("California", size(huge)) name(ca, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="CO" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Colorado", size(huge)) name(co, replace) 
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="CT" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Connecticut", size(huge)) name(ct, replace)     
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="DE" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Delaware", size(huge)) name(de, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="FL" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Florida", size(huge)) name(fl, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="GA" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Georgia", size(huge)) name(ga, replace)   
{res}{txt}
{com}. 
. twoway line resent_score year if state_abbrev=="HI"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Hawaii", size(huge)) name(hi, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="ID"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Idaho", size(huge)) name(id, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="IL" , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Illinois", size(huge)) name(il, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="IN"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///   
>         ylabel(, labsize(large)) title("Indiana", size(huge)) name(ind, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="IA"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///   
>         ylabel(, labsize(large)) title("Iowa", size(huge)) name(ia, replace)    
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="KS"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Kansas", size(huge)) name(ks, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="KY"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Kentucky", size(huge)) name(ky, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="LA"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Louisiana", size(huge)) name(la, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="ME"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Maine", size(huge)) name(me, replace)           
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="MD"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Maryland", size(huge)) name(md, replace)   
{res}{txt}
{com}.         
. twoway line resent_score year if state_abbrev=="MA"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Massachusetts", size(huge)) name(ma, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="MI"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Michigan", size(huge)) name(mi, replace)                
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="MN"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Minnesota", size(huge)) name(mn, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="MS"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Mississippi", size(huge)) name(ms, replace)     
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="MO"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// / 
>         ylabel(, labsize(large)) title("Missouri", size(huge)) name(mo, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="MT"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Montana", size(huge)) name(mt, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="NE"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Nebraska", size(huge)) name(ne, replace)        
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="NV"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Nevada", size(huge)) name(nv, replace) 
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="NH"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("New Hampshire", size(huge)) name(nh, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="NJ"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("New Jersey", size(huge)) name(nj, replace)   
{res}{txt}
{com}.         
. twoway line resent_score year if state_abbrev=="NM"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("New Mexico", size(huge)) name(nm, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="NY"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("New York", size(huge)) name(ny, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="NC"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("North Carolina", size(huge)) name(nc, replace)          
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="ND"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("North Dakota", size(huge)) name(nd, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="OH"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Ohio", size(huge)) name(oh, replace)   
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="OK"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Oklahoma", size(huge))name(ok, replace) 
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="OR"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Oregon", size(huge)) name(or, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="PA"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Pennsylvania", size(huge)) name(pa, replace)    
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="RI"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Rhode Island", size(huge)) name(ri, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="SC"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("South Carolina", size(huge)) name(sc, replace)  
{res}{txt}
{com}. 
. twoway line resent_score year if state_abbrev=="SD"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("South Dakota", size(huge)) name(sd, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="TN"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Tennessee", size(huge)) name(tn, replace)       
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="TX"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Texas", size(huge)) name(tx, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="UT"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Utah", size(huge)) name(ut, replace) 
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="VT"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Vermont", size(huge)) name(vt, replace)                 
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="VA"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Virginia", size(huge)) name(va, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="WA"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Washington", size(huge)) name(wa, replace)      
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="WV"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("West Virginia", size(huge)) name(wv, replace)  
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="WI"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) ///  
>         ylabel(, labsize(large)) title("Wisconsin", size(huge)) name(wi, replace) 
{res}{txt}
{com}. twoway line resent_score year if state_abbrev=="WY"  , lwidth(thick) lcolor(ebblue) legend(label(1 "State RR")) ///
>         xtitle("Year", size(vlarge)) ylabel(0(.1)1) lpattern(solid) graphregion(color(white)) /// 
>         ylabel(, labsize(large)) title("Wyoming", size(huge))name(wy, replace)          
{res}{txt}
{com}.                 
. grc1leg al ak az ar ca co ct de fl ga hi id il ind ia ks ky la me md ma mi mn ms mo, col(5) iscale(1) altshrink xcom ycom  ///
>         title("Racial Resentment in the States, Part 1") note("Common scale for all states") graphregion(color(white)) 
{res}{txt}
{com}. 
. grc1leg mt ne nv nh nj nm ny nc nd oh ok or pa ri sc sd tn tx ut vt va wa wv wi wy, col(5) iscale(1) altshrink xcom ycom  ///
>         title("Racial Resentment in the States, Part 2") note("Common scale for all states") graphregion(color(white)) 
{res}{txt}
{com}.         
.         
.         /*********************************/
.         * Figure A3: Mapping Annual Racial Resentment in the States, Relative to Other States
.         * note: This is similar to Figure 3, but with deciles in lieu of quintiles. Quintiles for each map are calculated using data from that year only. 
.         * As such, the individual maps should not be directly compared to each other. However, it is appropriate to compare to maps to observe patterns in 
.         * which states have racial resentment scores in the higher and low quintiles of the data.
.         /*********************************/
.         
.         * generate deciles for maps for each year
. xtile yeardecile88=resent1988, n(10)
{txt}
{com}. xtile yeardecile90=resent1990, n(10)
{txt}
{com}. xtile yeardecile92=resent1992, n(10)
{txt}
{com}. xtile yeardecile94=resent1994, n(10)
{txt}
{com}. xtile yeardecile00=resent2000, n(10)
{txt}
{com}. xtile yeardecile04=resent2004, n(10)
{txt}
{com}. xtile yeardecile08=resent2008, n(10)
{txt}
{com}. xtile yeardecile12=resent2012, n(10)
{txt}
{com}. xtile yeardecile16=resent2016, n(10)
{txt}
{com}. 
. maptile yeardecile88 if year == 1988, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("1988") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("1988dbw") replace
{res}{txt}(note: file 1988dbw.gph not found)
{res}{txt}(file 1988dbw.gph saved)

{com}.         
.  maptile yeardecile90 if year == 1990, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("1990") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("1990dbw")  replace   
{res}{txt}(note: file 1990dbw.gph not found)
{res}{txt}(file 1990dbw.gph saved)

{com}.         
.  maptile yeardecile92 if year == 1992, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("1992") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("1992dbw") replace 
{res}{txt}(note: file 1992dbw.gph not found)
{res}{txt}(file 1992dbw.gph saved)

{com}.         
.  maptile yeardecile94 if year == 1994, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("1994") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("1994dbw") replace 
{res}{txt}(note: file 1994dbw.gph not found)
{res}{txt}(file 1994dbw.gph saved)

{com}.         
.  maptile yeardecile00 if year == 2000, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2000") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("2000dbw")  replace   
{res}{txt}(note: file 2000dbw.gph not found)
{res}{txt}(file 2000dbw.gph saved)

{com}. 
.  maptile yeardecile04 if year == 2004, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2004") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("2004dbw") replace
{res}{txt}(note: file 2004dbw.gph not found)
{res}{txt}(file 2004dbw.gph saved)

{com}.         
. maptile yeardecile08 if year == 2008, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2008") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("2008dbw")  replace
{res}{txt}(note: file 2008dbw.gph not found)
{res}{txt}(file 2008dbw.gph saved)

{com}.         
.  maptile yeardecile12 if year == 2012, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2012") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("2012dbw")  replace
{res}{txt}(note: file 2012dbw.gph not found)
{res}{txt}(file 2012dbw.gph saved)

{com}. 
.  maptile yeardecile16 if year == 2016, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2016") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("2016dbw")  replace
{res}{txt}(note: file 2016dbw.gph not found)
{res}{txt}(file 2016dbw.gph saved)

{com}. 
. * create the map for figure A3
. graph combine 1988dbw.gph 1990dbw.gph 1992dbw.gph 1994dbw.gph 2000dbw.gph 2004dbw.gph 2008dbw.gph 2012dbw.gph 2016dbw.gph, scheme(s1color) ///
>         rows(3) cols(3) ///
>         imargin(tiny) ///
>         xsize(6) ysize(4) 
{res}{txt}
{com}.         
.         /*********************************/
.         * Figure A4: Changes in Estimated Racial Resentment in Over Time, Sort by Racial Resentment in 2016
.         * note: This is similar to Figure 4, but instead sorted by estimated racial resentment in 2016.
.         /*********************************/
.         
.         graph dot resent1988 resent1990 resent1992 resent1994 resent2000 resent2004 ///
>         resent2008 resent2012 resent2016, over(state_abbrev, sort(resent2016) label(labsize(vsmall))) nofill ndots(60) ///
>         marker(1, mcolor(black) msymbol(circle_hollow) msize(small)) ///
>         marker(2, mcolor(gs2) msymbol(plus) msize(small)) ///
>         marker(3, mcolor(gs4) msymbol(diamond_hollow) msize(small))  /// 
>         marker(4, mcolor(gs6) msymbol(triangle_hollow) msize(small))  /// 
>         marker(5, mcolor(gs8) msymbol(square_hollow) msize(small))  /// 
>         marker(6, mcolor(gs9) msymbol(circle) msize(small))  /// 
>         marker(7, mcolor(gs10) msymbol(diamond) msize(small))  /// 
>         marker(8, mcolor(gs11) msymbol(triangle) msize(small))  /// 
>         marker(9, mcolor(gs12) msymbol(square) msize(small))  /// 
>         graphregion(margin(medsmall)) legend(row(1) label(1 "1988") label(2 "1990") label(3 "1992") ///
>         label(4 "1994") label(5 "2000") label(6 "2004") label(7 "2008") label(8 "2012") label(9 "2016")) ///
>         ylabel(#25, labsize(small))  graphregion(color(white))
{res}{txt}
{com}.         
.         /*********************************/
.         * Figure A5: Mapping Annual Racial Resentment in the States, Relative to Other States
.         * note: TThis is similar to Figure 5, but with deciles in lieu of quintiles. Quintiles for each map are calculated using data from that year only. 
.         * As such, the individual maps should not be directly compared to each other. However, it is appropriate to compare to maps to observe patterns in 
.         * which states have racial resentment scores in the higher and low quintiles of the data.
.         /*********************************/
.         
. xtile decile=resent_score, n(10)        
{txt}
{com}.         
. maptile decile if year == 1988, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("1988") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("t1988dbw") replace           
{res}{txt}(note: file t1988dbw.gph not found)
{res}{txt}(file t1988dbw.gph saved)

{com}.         
.  maptile decile if year == 1990, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("1990") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("t1990dbw") replace 
{res}{txt}(note: file t1990dbw.gph not found)
{res}{txt}(file t1990dbw.gph saved)

{com}.         
.  maptile decile if year == 1992, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("1992") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("t1992dbw") replace
{res}{txt}(note: file t1992dbw.gph not found)
{res}{txt}(file t1992dbw.gph saved)

{com}. 
.  maptile decile if year == 1994, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("1994") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("t1994dbw") replace   
{res}{txt}(note: file t1994dbw.gph not found)
{res}{txt}(file t1994dbw.gph saved)

{com}.         
.  maptile decile if year == 2000, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2000") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("t2000dbw") replace           
{res}{txt}(note: file t2000dbw.gph not found)
{res}{txt}(file t2000dbw.gph saved)

{com}. 
.  maptile decile if year == 2004, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2004") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("t2004dbw") replace
{res}{txt}(note: file t2004dbw.gph not found)
{res}{txt}(file t2004dbw.gph saved)

{com}.         
. maptile decile if year == 2008, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2008") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("t2008dbw") replace
{res}{txt}(note: file t2008dbw.gph not found)
{res}{txt}(file t2008dbw.gph saved)

{com}. 
.  maptile decile if year == 2012, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2012") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("t2012dbw") replace
{res}{txt}(note: file t2012dbw.gph not found)
{res}{txt}(file t2012dbw.gph saved)

{com}.         
.  maptile decile if year == 2016, geo(state) geoid(statefips) cutvalue(1 2 3 4 5 6 7 8 9) ///
>         fcolor(gs14 gs13 gs12 gs11 gs9 gs7 gs6 gs5 gs4 gs3) ///
>         legd(0) twopt(title("2016") legend(lab(2 "1") lab(3 "2") lab(4 "3") lab(5 "4") lab(6 "5") lab(7 "6") ///
>         lab(8 "7") lab(9 "8") lab(10 "9") lab(11 "10"))) ///
>         savegraph("t2016dbw") replace
{res}{txt}(note: file t2016dbw.gph not found)
{res}{txt}(file t2016dbw.gph saved)

{com}. 
. graph combine t1988dbw.gph t1990dbw.gph t1992dbw.gph t1994dbw.gph t2000dbw.gph t2004dbw.gph t2008dbw.gph t2012dbw.gph t2016dbw.gph, scheme(s1color) ///
>         rows(3) cols(3) ///
>         imargin(tiny) ///
>         xsize(6) ysize(4) 
{res}{txt}
{com}. 
.         /*********************************/
.         * Figure A2: Racial Resentment by Region, Over Time     
.         * note: This is similar to Figure 2, but shows the four regions as determined by the US Census.
.         /*********************************/
.         
. * Generate regional variable
. gen region = .
{txt}(450 missing values generated)

{com}. label define region 1 "Northeast" 2 "West" 3 "Midwest" 4 "South"
{txt}
{com}. *1= NE, 3 = MW, 2 = W, 4 = S
.          replace region = 3 if state_abbrev == "IA"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "IL"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "IN"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "KS"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "MI"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "MN"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "MO"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "ND"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "NE"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "OH"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "SD"
{txt}(9 real changes made)

{com}.          replace region = 3 if state_abbrev == "WI"
{txt}(9 real changes made)

{com}. 
.          replace region = 1 if state_abbrev == "CT"
{txt}(9 real changes made)

{com}.          replace region = 1 if state_abbrev == "MA"
{txt}(9 real changes made)

{com}.          replace region = 1 if state_abbrev == "ME"
{txt}(9 real changes made)

{com}.          replace region = 1 if state_abbrev == "NH"
{txt}(9 real changes made)

{com}.          replace region = 1 if state_abbrev == "NJ"
{txt}(9 real changes made)

{com}.          replace region = 1 if state_abbrev == "NY"
{txt}(9 real changes made)

{com}.          replace region = 1 if state_abbrev == "PA"
{txt}(9 real changes made)

{com}.          replace region = 1 if state_abbrev == "RI"
{txt}(9 real changes made)

{com}.          replace region = 1 if state_abbrev == "VT"
{txt}(9 real changes made)

{com}. 
.          replace region = 4 if state_abbrev == "AL"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "AR"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "DE"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "FL"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "GA"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "KY"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "LA"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "MD"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "MS"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "NC"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "OK"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "SC"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "TN"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "TX"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "VA"
{txt}(9 real changes made)

{com}.          replace region = 4 if state_abbrev == "WV"
{txt}(9 real changes made)

{com}. 
.          replace region = 2 if state_abbrev == "AK"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "AZ"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "CA"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "CO"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "HI"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "ID"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "MT"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "NM"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "NV"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "OR"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "UT"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "WA"
{txt}(9 real changes made)

{com}.          replace region = 2 if state_abbrev == "WY"
{txt}(9 real changes made)

{com}.         
.         collapse resent_score, by(region year)
{txt}
{com}. 
.         graph twoway line resent_score year if region == 1, lcolor(gs0) lpattern(solid) || ///
>          line resent_score year if region == 2, lcolor(gs3) lpattern(shortdash) || ///
>          line resent_score year if region == 3,lcolor(gs0) lpattern(longdash)  || ///
>          line resent_score year if region == 4, lcolor(gs2) lpattern(dash_dot) ///
>          graphregion(color(white)) ytitle(Racial Resentment by Region) ylabel(0(.1)1) ///
>          legend(label(1 "Northeast") label(2 "West") label(3 "Midwest") label(4 "South")) 
{res}{txt}
{com}.  
.         
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/rkreit/Dropbox/Research/MRP Racial Resentment/Perspectives on Politics/Final Files/Replication Files/replicate_resentmentperspectives.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res} 3 Jul 2019, 12:37:45
{txt}{.-}
{smcl}
{txt}{sf}{ul off}